package com.app.teaware.bean;

import android.text.TextUtils;

import com.alibaba.fastjson.annotation.JSONField;
import com.app.teaware.R;

public class MessageListData extends BasisBean {
    /**
     *
     */
    private static final long serialVersionUID = 1L;

    public static final String MSG_TYPE_NOTICE = "ZD1001";

    /**
     * id : 5f350ab4bfe523000107c594
     * createUser : 35102770
     * createUserName : 曾德猛
     * createTime : 2020-08-13 17:41:08
     * updateUser : 35102770
     * updateUserName : 曾德猛
     * updateTime : 2020-08-13 17:41:08
     * version : 1
     * projectNo : 1190001
     * title : 公务用车申请审批通知
     * content : 您审批/申请过的《admin公务用车申请审批》审批已结束，点击查看详情。
     * status : 2
     * sendTime : null
     * alias : 1190001_13000000000
     * messageId : 5f350ab4bfe523000107c592
     * appId : 80001
     * msgCode : ZD_CAR_END
     * appTemp : 您审批/申请过的《${name}公务用车申请审批》审批已结束，点击查看详情。
     * userCode : a6c5260fcc71d2a18ec7f5d52f1b96e5
     * mobile : 13000000000
     * userId : a6c5260fcc71d2a18ec7f5d52f1b96e5
     * refId : tbMbAppMessage.getId()
     * result : null
     * deviceType : null
     * dataId : null
     * dataNo : null
     * readStatus : 1
     * readTime : null
     */

    /**
     * msgCode
     * 警情 -> 警情地图
     *         ZD0005 支队警情调度
     * 公告 -> 公告详情
     *         ZD1001
     * 派车 -> 派车单详情，根据权限、状态的不同展示不同的按钮
     *         ZD_CAR_APPLY
     *         ZD_CAR_PROCESS
     *         ZD_CAR_END
     *         ZD_CAR_DRIVER
     *         ZD_CAR_CANCEL
     *         ZD_CAR_CANCEL_DRIVER
     *         ZD_CAR_RECORD
     *         ZD_CAR_DRIVE_START
     *         CAR_DRIVE_END
     * **/

    private String id;
    private String createUser;
    private String createUserName;
    private String createTime;
    private String updateUser;
    private String updateUserName;
    private String updateTime;
    private int version;
    private String projectNo;
    private String title;
    private String content;
    private int status;
    private String sendTime;
    private String alias;
    private String messageId;
    private String appId;
    private String msgCode;
    private String appTemp;
    private String userCode;
    private String mobile;
    private String userId;
    private String refId;
    private String result;
    private String deviceType;
    private String dataId;
    private String dataNo;
    private int readStatus;
    private String readTime;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getCreateUserName() {
        return createUserName;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    public String getUpdateUserName() {
        return updateUserName;
    }

    public void setUpdateUserName(String updateUserName) {
        this.updateUserName = updateUserName;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public String getProjectNo() {
        return projectNo;
    }

    public void setProjectNo(String projectNo) {
        this.projectNo = projectNo;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getSendTime() {
        return sendTime;
    }

    public void setSendTime(String sendTime) {
        this.sendTime = sendTime;
    }

    public String getAlias() {
        return alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    public String getMessageId() {
        return messageId;
    }

    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getMsgCode() {
        return msgCode;
    }
    @JSONField(serialize = false)
    public boolean isMsgCarType(){
        if(TextUtils.isEmpty(msgCode))return false;
        if(msgCode.startsWith("ZD_CAR")){
            return true;
        }
        return false;
    }

    @JSONField(serialize = false)
    public boolean isMsgTypeHrmanage(){
        if(TextUtils.isEmpty(msgCode))return false;
        if(msgCode.equals("ZD_CODE_TEAM_INFO_CHECK_PASS")){
            return true;
        }
        if(msgCode.equals("ZD_CODE_TEAM_INFO_CHECK_FAIL")){
            return true;
        }
        return false;
    }

    public void setMsgCode(String msgCode) {
        this.msgCode = msgCode;
    }

    public String getAppTemp() {
        return appTemp;
    }

    public void setAppTemp(String appTemp) {
        this.appTemp = appTemp;
    }

    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getRefId() {
        return refId;
    }

    public void setRefId(String refId) {
        this.refId = refId;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public String getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    public String getDataId() {
        return dataId;
    }

    public void setDataId(String dataId) {
        this.dataId = dataId;
    }

    public String getDataNo() {
        return dataNo;
    }

    public void setDataNo(String dataNo) {
        this.dataNo = dataNo;
    }

    public int getReadStatus() {
        return readStatus;
    }

    public boolean isRead_BOOLEAN(){
        return readStatus ==2;
    }

    public void setReadStatus(int readStatus) {
        this.readStatus = readStatus;
    }
    public void setReadStatus_READ() {
        this.readStatus = 2;
    }
    public String getReadTime() {
        return readTime;
    }

    public void setReadTime(String readTime) {
        this.readTime = readTime;
    }

    @JSONField(serialize = false)
    public int getImgRes(){

        if(TextUtils.isEmpty(msgCode)){
            return  isRead_BOOLEAN()? R.drawable.news_icon_notice_b:R.drawable.news_icon_notice;
        }
        if(msgCode.startsWith("ZD_CAR")){
            return  isRead_BOOLEAN()? R.drawable.news_icon_car_b:R.drawable.news_icon_car;
        }else  if(msgCode.startsWith("ZD_VISIT")){
            return  isRead_BOOLEAN()? R.drawable.news_icon_visitors_b:R.drawable.news_icon_visitors;
        }else if(isMsgTypeHrmanage()){
            return  isRead_BOOLEAN()? R.drawable.message_icon_hr_b:R.drawable.message_icon_hr;
        }else  if(msgCode.startsWith("ZD_IMEI_CHANGE")){
            return  isRead_BOOLEAN()? R.drawable.message_icon_unicode_b:R.drawable.message_icon_unicode;
        }else  if(msgCode.startsWith("ZD_SMART_KEY")){
            return  isRead_BOOLEAN()? R.drawable.news_icon_key_b:R.drawable.news_icon_key;
        }else {
            return  isRead_BOOLEAN()? R.drawable.news_icon_notice_b:R.drawable.news_icon_notice;
        }

    }
}
